import { createI18n } from 'vue-i18n'
import zh from './modules/zh'
import en from './modules/en'
import vxeZh from 'vxe-pc-ui/lib/language/zh-CN'
import vxeEn from 'vxe-pc-ui/lib/language/en-US'

export const i18n = createI18n({
  legacy: false,
  // globalInjection: true,
  fallbackLocale: 'en',
  locale: localStorage.getItem('language') || 'en',
  messages: {
    zh: {
      ...zh,
      ...vxeZh
    },
    en: {
      ...en,
      ...vxeEn
    }
  }
})

export const $t = i18n.global.t
